package com.hsgene.user.dto.user.customer;

import com.hsgene.common.util.date.BirthdayDateSerializer;
import com.hsgene.common.util.date.TimeJsonDeserializer;
import com.hsgene.common.util.web.session.UserSession;
import com.hsgene.user.dto.user.AbstractUserDto;
import org.apache.commons.lang.StringUtils;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.util.Date;

/**
 * 客户信息Dto
 *
 * @author wangbing
 * @version 1.0, 2018/7/11
 */
public class CustomerDto extends AbstractUserDto implements Serializable {

    private static final long serialVersionUID = 8659273604155551964L;

    /**
     * 用户默认头像（TODO 暂定）
     */
    private static final String DEFAULT_HEAD_IMAGE = "http://pdjbl8tck.bkt.clouddn.com/logo_app_1024.png";

    /**
     * 登录手机号
     */
    private String phone;

    /**
     * 登录密码
     */
    private String password;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 头像
     */
    private String headImage;

    /**
     * 年龄
     */
    private Short age;

    /**
     * 性别(int)：0 = 保密，1 = 男，2 = 女
     */
    private Byte gender;

    /**
     * 职业
     */
    private String profession;

    /**
     * 出生生日
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    @JsonSerialize(using = BirthdayDateSerializer.class)
    private Date birthday;

    /**
     * 是否删除
     */
    private Boolean deleted;

    /**
     * 用户会话信息
     */
    private UserSession userSession;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadImage() {
        return StringUtils.isBlank(headImage) ? DEFAULT_HEAD_IMAGE : headImage;
    }

    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }

    public Short getAge() {
        return age;
    }

    public void setAge(Short age) {
        this.age = age;
    }

    public Byte getGender() {
        return gender;
    }

    public void setGender(Byte gender) {
        this.gender = gender;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public UserSession getUserSession() {
        return userSession;
    }

    public void setUserSession(UserSession userSession) {
        this.userSession = userSession;
    }

    public String getProfession() {
        return profession;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
